﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FundingFrame.ascx.cs" Inherits="AB.ServiceDirectory.Design.WebUserControls.Frame.FundingFrame" %>
<%@ Register TagPrefix="wuc" TagName="ContactLookupPopup" Src="~/WebUserControls/Lookup/ContactLookupUserControl.ascx" %>
<script src="../../js/jquery.ui/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
    // Initialize calendar for the textboxs
    $(function () {
        $(".funding-start").datepicker({ dateFormat: 'dd/mm/yy' });
        $(".funding-end").datepicker({ dateFormat: 'dd/mm/yy' });
        $(".fundraising-required-by").datepicker({ dateFormat: 'dd/mm/yy' });
        $("#TextBoxFundraisingCompletedDate").datepicker({ dateFormat: 'dd/mm/yy' });
        $(".fundraising-donation-date").datepicker({ dateFormat: 'dd/mm/yy' });
    });

    // Set Funding Continuation state when check radio button
    function set_funding_continuation() {
        if ($('#CheckBoxFundingContinuationNeeded').attr('checked')) {
            $('.funding-continuation-amount').removeAttr('disabled').removeClass('st-disable');
            $('.funding-continuation-details').removeAttr('disabled').removeClass('st-disable');
        } else {
            $('.funding-continuation-amount').attr('disabled', 'disabled').addClass('st-disable');
            $('.funding-continuation-details').attr('disabled', 'disabled').addClass('st-disable');
        }
    }

    // Set Fundraising Complete state when check radio button
    function set_fundraising_complete() {
        if ($('#CheckBoxFundraisingComplete').attr('checked')) {
            $('#TextBoxFundraisingCompletedDate').removeAttr('disabled').removeClass('st-disable').addClass('datepicker-input');
            $('#TextBoxFundraisingCompletedDate').removeAttr('disabled').removeClass('st-disable').addClass('datepicker-input');
        } else {
            $('#TextBoxFundraisingCompletedDate').attr('disabled', 'disabled').addClass('st-disable').removeClass('datepicker-input');
            $('#TextBoxFundraisingCompletedDate').attr('disabled', 'disabled').addClass('st-disable').removeClass('datepicker-input');
        }
    }
</script>

<!-- LINE 1:  Funding Source & Funding Needs-->
<strong>General</strong>
<div class="st-form-line-noleft">
    <div class="half">
        <asp:Label ID="LabelFundingSource" runat="server" Text="Funding Source" CssClass="st-labeltext level1" AssociatedControlID="DropDownListFundingSource" />
        <asp:DropDownList ID="DropDownListFundingSource" runat="server" 
            CssClass="st-forminput" Width="210px" AppendDataBoundItems="True">
        </asp:DropDownList>
    </div>
    <div class="half last">
        <asp:Label ID="LabelFundingNeeds" runat="server" Text="Funding Needs" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundingNeeds" />
        <asp:TextBox ID="TextBoxFundingNeeds" runat="server" CssClass="st-forminput" Width="100px"></asp:TextBox>
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorFundingNeeds" runat="server" ErrorMessage="- Funding needs format must be is digits" ControlToValidate="TextBoxFundingNeeds" Operator="DataTypeCheck" SetFocusOnError="True" ForeColor="#990033" Display="Dynamic" Type="Double" />
    </div>
    <div class="clear"></div>
</div>

<!-- LINE 2:  Funding Contact Details & Funding Continuation Needed -->
<div class="st-form-line-noleft">
    <div class="half">
        <asp:UpdatePanel ID="UpdatePanelFundingContact" runat="server">
            <ContentTemplate>
                <asp:Label ID="LabelFundingContact" runat="server" Text="Funding Contact Details" CssClass="st-labeltext level1 required"
                    AssociatedControlID="TextBoxFundingContact"></asp:Label><asp:TextBox ID="TextBoxFundingContact"
                        CssClass="st-forminput st-disable" runat="server" Width="150px" ReadOnly="True"></asp:TextBox>
                <asp:LinkButton ID="ButtonFundingContactLookup" runat="server" CssClass="hg-blue" Text="Lookup" CausesValidation="False"
                            CommandName="contact" OnCommand="ButtonFundingContactLookup_Command" />
                <asp:HiddenField ID="HiddenFieldFundingContactId" runat="server" />
                <asp:RequiredFieldValidator 
                    ID="RequiredLeadContact" runat="server" ErrorMessage="*"
                    Display="None" SetFocusOnError="true" ForeColor="#990033" 
                    ControlToValidate="TextBoxFundingContact" />

                <wuc:ContactLookupPopup ID="ContactLookupPopup" runat="server" TextBoxResultId="TextBoxFundingContact"
                    HiddenFieldResultId="HiddenFieldFundingContactId" MaximumRows="5" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div class="half last">
        <asp:Label ID="LabelFundingContinuation" runat="server" Text="Funding Continuation Needed" CssClass="st-labeltext level1" AssociatedControlID="CheckBoxFundingContinuationNeeded" />
        <asp:CheckBox ID="CheckBoxFundingContinuationNeeded" ClientIDMode="Static" CssClass="funding-continuation-needed" runat="server" onclick="set_funding_continuation()"/>
    </div>
    <div class="clear"></div>
</div>

<!-- LINE 3: Funding Amount & Funding Continuation Amount -->
<div class="st-form-line-noleft">
    <div class="half">
        <asp:Label ID="LabelFundingAmount" runat="server" Text="Funding Amount" CssClass="st-labeltext level1 required" AssociatedControlID="TextBoxFundingAmount" />
        <asp:TextBox ID="TextBoxFundingAmount" runat="server" CssClass="st-forminput" Width="100px" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidatorFundingAmount" ControlToValidate="TextBoxFundingAmount" runat="server" ErrorMessage="*" Display="None" SetFocusOnError="true" />
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorFundingAmount" runat="server" ErrorMessage="- Funding amount format must be is digits" ControlToValidate="TextBoxFundingAmount" Operator="DataTypeCheck" SetFocusOnError="True" ForeColor="#990033" Display="Dynamic" Type="Double" />
    </div>
    <div class="half last">
        <asp:Label ID="LabelContinuationAmount" runat="server" Text="Funding Continuation Amount" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundingContinuationAmount" />
        <asp:TextBox ID="TextBoxFundingContinuationAmount" runat="server" 
            CssClass="st-forminput st-disable funding-continuation-amount" 
            Width="100px" Enabled="False"/>
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorFundingContinuationAmount" runat="server" ErrorMessage="- Funding continuation amount format must be is digits" ControlToValidate="TextBoxFundingContinuationAmount" Operator="DataTypeCheck" SetFocusOnError="True" ForeColor="#990033" Display="Dynamic" Type="Double" />
    </div>
    <div class="clear"></div>
</div>

<!-- LINE 4: Funding Start - End & Funding Continuation Details -->
<div class="st-form-line-noleft">
    <div class="half">
        <asp:Label ID="LabelFundingStart" runat="server" Text="Funding Start" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundingStart" />
        <asp:TextBox ID="TextBoxFundingStart" runat="server" CssClass="st-forminput inputDate datepicker-input funding-start" Width="100px" />
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorFundingStart" 
            ControlToValidate="TextBoxFundingStart" SetFocusOnError="true" runat="server" 
            ErrorMessage="Date format must be correct" Display="Dynamic" 
            ForeColor="#990033" Operator="DataTypeCheck" Type="Date" />
        <h3>&nbsp;</h3>
        <asp:Label ID="LabelFundingEnd" runat="server" Text="Funding End" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundingEnd" />
        <asp:TextBox ID="TextBoxFundingEnd" runat="server" CssClass="st-forminput st-forminput inputDate datepicker-input funding-end" Width="100px" />
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorFundingEnd" 
            ControlToValidate="TextBoxFundingEnd" SetFocusOnError="true" runat="server" 
            ErrorMessage="Date format must be correct" Display="Dynamic" 
            ForeColor="#990033" Operator="DataTypeCheck" Type="Date" />
    </div>
    <div class="half last">
        <asp:Label ID="LabelFundingContinuationDetails" runat="server" Text="Funding Continuation Details" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundingContinuationDetails" />
        <asp:TextBox ID="TextBoxFundingContinuationDetails" runat="server" 
            CssClass="st-forminput st-disable funding-continuation-details" Width="210px" 
            TextMode="MultiLine" Rows="3" Enabled="False"/>
    </div>
    <div class="clear"></div>
</div>

<strong>Fundraising For Service Project</strong>
<!-- LINE 5: Fundraising For Text & Fundraising Needs & Fundraising Required By -->
<div class="st-form-line-noleft">
    <div class="half">
        <asp:Label ID="LabelFundraisingForText" runat="server" Text="Fundraising For Text" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundraisingForText" />
        <asp:TextBox ID="TextBoxFundraisingForText" runat="server" CssClass="st-forminput" Width="210px" TextMode="MultiLine" Rows="3"/>
    </div>
    <div class="half last">
        <asp:Label ID="LabelFundraisingNeeds" runat="server" Text="Fundraising Needs" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundraisingNeeds" />
        <asp:TextBox ID="TextBoxFundraisingNeeds" runat="server" CssClass="st-forminput" Width="100px" />
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorFundraisingNeeds" runat="server" ErrorMessage="- Fundraising needs format must be is digits" ControlToValidate="TextBoxFundraisingNeeds" Operator="DataTypeCheck" SetFocusOnError="True" ForeColor="#990033" Display="Dynamic" Type="Double" />
        <h3>&nbsp;</h3>
        <asp:Label ID="LabelFundraisingRequiredBy" runat="server" Text="Fundraising Required By" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundraisingNeeds" />
        <asp:TextBox ID="TextBoxFundraisingRequiredBy" runat="server" CssClass="st-forminput inputDate datepicker-input fundraising-required-by" Width="100px" />
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorFundraisingRequiredBy" 
            ControlToValidate="TextBoxFundraisingRequiredBy" SetFocusOnError="true" 
            runat="server" ErrorMessage="Date format must be correct" Display="Dynamic" 
            ForeColor="#990033" Operator="DataTypeCheck" Type="Date" />
    </div>
    <div class="clear"></div>
</div>

<!-- LINE 6: Fundraising Why & Fundraising Complete & Fundraising Completed Date-->
<div class="st-form-line-noleft">
    <div class="half">
        <asp:Label ID="LabelFundraisingWhy" runat="server" Text="Fundraising Why" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundraisingWhy" />
        <asp:TextBox ID="TextBoxFundraisingWhy" runat="server" CssClass="st-forminput" Width="210px" TextMode="MultiLine" Rows="3"/>             
    </div>
    <div class="half last">
        <asp:Label ID="LabelFundraisingComplete" runat="server" Text="Fundraising Complete" CssClass="st-labeltext level1" AssociatedControlID="CheckBoxFundraisingComplete" />
        <asp:CheckBox ID="CheckBoxFundraisingComplete" runat="server" ClientIDMode="Static" onclick="set_fundraising_complete()"/>
        <h3>&nbsp;</h3>
        <asp:Label ID="LabelCompletedDate" runat="server" Text="Fundraising Completed Date" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundraisingCompletedDate" />
        <asp:TextBox ID="TextBoxFundraisingCompletedDate" runat="server" 
            CssClass="st-forminput st-disable" 
            Width="100px" ClientIDMode="Static" Enabled="False" />   
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorCompletedDate" 
            ControlToValidate="TextBoxFundraisingCompletedDate" SetFocusOnError="true" 
            runat="server" ErrorMessage="Date format must be correct" Display="Dynamic" 
            ForeColor="#990033" Operator="DataTypeCheck" Type="Date" />
    </div>
    <div class="clear"></div>
</div>

<strong>Fundraising Donor</strong>
<!-- LINE 7: Fundraising Donor Anonymous & Fundraising Donation Date -->
<div class="st-form-line-noleft">
    <div class="half">
        <asp:Label ID="LabelFundraisingDonorAnonymous" runat="server" Text="Fundraising Donor Anonymous" CssClass="st-labeltext level1" AssociatedControlID="CheckBoxFundraisingDonorAnonymous" />
        <asp:CheckBox ID="CheckBoxFundraisingDonorAnonymous" runat="server" />
    </div>
    <div class="half last">
        <asp:Label ID="LabelFundraisingDonationDate" runat="server" Text="Fundraising Donation Date" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundraisingDonationDate" />
        <asp:TextBox ID="TextBoxFundraisingDonationDate" runat="server" CssClass="st-forminput inputDate datepicker-input fundraising-donation-date" Width="100px" />   
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorFundraisingDonationDate" 
            ControlToValidate="TextBoxFundraisingDonationDate" SetFocusOnError="true" 
            runat="server" ErrorMessage="Date format must be correct" Display="Dynamic" 
            ForeColor="#990033" Operator="DataTypeCheck" Type="Date" />
    </div>
    <div class="clear"></div>
</div>

<!-- LINE 8: Fundraising -->
<div class="st-form-line-noleft">
    <div class="half">
        <asp:Label ID="LabelFundraisingDonorAmount" runat="server" Text="Fundraising Donor Amount" CssClass="st-labeltext level1" AssociatedControlID="TextBoxFundraisingDonorAmount" />
        <asp:TextBox ID="TextBoxFundraisingDonorAmount" runat="server" CssClass="st-forminput" Width="100px" />  
        <div class="clear"></div>
        <asp:CompareValidator ID="CompareValidatorFundraisingDonorAmount" runat="server" ErrorMessage="- Fundraising donor amount format must be is digits" ControlToValidate="TextBoxFundraisingDonorAmount" Operator="DataTypeCheck" SetFocusOnError="True" ForeColor="#990033" Display="Dynamic" Type="Double" />
    </div>
    <div class="half last">
        <asp:Label ID="LabelDonationIncremental" runat="server" Text="Fundraising Donation Incremental" CssClass="st-labeltext level1" AssociatedControlID="CheckBoxDonationIncremental" />
        <asp:CheckBox ID="CheckBoxDonationIncremental" runat="server" />
    </div>
    <div class="clear"></div>
</div>

<!--CONTACT LOOKUP-->
